
public class Test {
    public static void main(String[] args) {
        CellPhone cellPhone = new CellPhone();
        cellPhone.alarmclock(new Bell() { //Bell接口的匿名内部类
            public void ring() {
                System.out.println("懒猪起床了");
            }
        });
    }
}
